Image processing method and terminal device, and system

ABSTRACT

An image processing method includes obtaining a reflective picture, superimposing the reflective picture on an icon, and changing a color value of at least one pixel in a part that is of the reflective picture and that overlaps the icon.

This application is a National Stage of International Patent ApplicationNo. PCT/CN2020/074984 filed on Feb. 13, 2020, which claims priority toChinese Patent Application No. 201910133543.3 filed on Feb. 22, 2019.Both of the aforementioned applications are hereby incorporated byreference in their entireties.

TECHNICAL FIELD

This application relates to the field of image processing, and inparticular, to an image processing method and terminal device, and asystem.

BACKGROUND

An icon is used to indicate software or an application to a user. In aprocess in which the user performs human-machine interaction with aterminal such as a mobile phone or a computer, the user clicks the iconby using a mouse or a finger to open the software or the application.The icon is a user's first impression of the software or theapplication, and has great impact on promotion of the software or theapplication.

Currently, the icon is mainly static, that is, the icon is displayed asa still picture on the terminal. More vendors propose dynamic iconsolutions. However, dynamic icons in the solutions are generally used inapplications such as a calendar and a clock, where icon statuses such astime and a date are refreshed at a specific interval according to thesolutions. For example, on an iPhone, a home screen clock icon changeswith time. For another example, on a Huawei phone, a calendar iconchanges with a date.

The dynamic icon is mainly applied to the software or the applicationsuch as the calendar or the clock. There is no dynamic icon solution forcommon software or a common application.

SUMMARY

Embodiments of this application provide an image processing method andterminal device, and a system, to enable an icon to display a dynamiceffect.

A first aspect of this application provides an image processing method,including:

obtaining a reflective picture, superimposing the reflective picture onan icon, and changing a color value of at least one pixel in a part thatis of the reflective picture and that overlaps the icon, to enable theicon to display a dynamic effect. Optionally, the reflective picture isa semitransparent picture. In this case, the dynamic effect of the iconmay be implemented when the icon is displayed.

In some possible implementations, the method for obtaining a reflectivepicture includes:

creating a fully transparent picture, setting at least one target pointin the fully transparent picture, setting a color value of the at leastone target point, and determining a color value of a remaining pixel inthe fully transparent picture based on the color value of the at leastone target point, to create a reflective picture with a gradient effect,where a reflective picture with a better effect should be a picture thatdoes not affect recognition of an icon and has relatively rich colors,for example, a picture with a gradient effect.

In some possible implementations, the determining a color value of aremaining pixel in the fully transparent picture based on the colorvalue of the at least one target point includes:

dividing the fully transparent picture into a plurality of triangles byusing the at least one target point, and for any point G in the fullytransparent picture, calculating a color value of the point G based oncolor values of three points of a triangle in which the point G islocated.

It should be noted that the fully transparent picture is divided, byusing four corners of the picture and the at least one target point,into a plurality of triangles that do not overlap each other, and then acolor value of any point in the fully transparent picture is calculatedbased on color values of three corners of a triangle in which the pointis located, so that a color value of any non-target point in the pictureshould be closer to a color value of a target point when the anynon-target point is closer to the target point, and color values of anytwo points are closer when the any two points are closer. In this way,the reflective picture with the gradient effect is obtained throughcalculation.

In some possible implementations, the calculating a color value of thepoint G based on color values of three points of a triangle in which thepoint G is located includes:

separately connecting the point G to the three points of the triangle,to divide the triangle into three parts, and calculating the color valueof the point G according to the following formula:G=C1×g1/g+C2×g2/g+C3×g3/g, where G represents the color value of thepoint G, g1, g2, and g3 respectively represent areas of the three partsof the triangle, and g represents an area of the triangle.

In this way, when the point G is close to a point, a proportion of anarea of a relative part of the point to the area of the triangleC1-C2-C3 is used as a proportion of impact of a color value of the pointon the point G. In this case, when the point G is closer to the point,impact of the point on the color value of the point G is greater, andthe color value of the point G is closer to the color value of thepoint.

In some possible implementations, both an edge of the reflective pictureand an edge of the icon are rectangular, and a length and a width of theedge of the reflective picture are respectively greater than a lengthand a width of the edge of the icon. In this case, the icon may becompletely placed in the reflective picture, to implement impact of thereflective picture on the icon, so as to implement the dynamic effect ofthe icon.

In some possible implementations, the changing a color value of at leastone pixel in a part that is of the reflective picture and that overlapsthe icon includes: changing a location of the icon in the reflectiveicon. Because the reflective picture is gradient, when the location ofthe icon in the reflective picture changes, the icon is at a differentlocation in the reflective picture, and a color value of the differentlocation in the reflective picture may be displayed on the icon, toimplement the dynamic effect of the icon.

In some possible implementations, before the changing a location of theicon in the reflective icon, the method further includes:

obtaining sensing information, and determining the location of the iconin the reflective icon based on the sensing information, so that aterminal device may obtain the sensing information, perform informationprocessing on the sensing information to obtain an informationprocessing result, and trigger the dynamic effect of the icon based onthe information processing result, where in this embodiment of thisapplication, the dynamic effect of the icon may be implemented byshaking the terminal device by a user.

In some possible implementations, the obtaining sensing informationincludes:

obtaining an angle between the terminal device and a horizontaldirection by using a gyroscope, performing normalization processing onthe angle to obtain a normalized value ranging from 0 to 1, anddetermining the location of the icon in the reflective icon based on thenormalized value, so that conversion between the sensing information andthe location of the icon in the reflective picture is implemented.

In some possible implementations, after the changing a color value of atleast one pixel in a part that is of the reflective picture and thatoverlaps the icon, the method further includes: obtaining a maskpicture, and performing image processing on the reflective picture byusing the mask picture.

Optionally, the reflective picture is a semitransparent picture, and analpha channel value of each pixel ranges from 0 to 1. Therefore, whenthe reflective picture is superimposed on the icon, an effect ofdisplaying both the icon and the reflective picture is formed, and arelatively dim color may be formed at a relatively bright location inthe icon. This may affect the recognition of the icon to some extent,resulting in poor user experience. Therefore, the reflective picture maybe further processed according to the foregoing method, so that a dimcolor does not appear at the relatively bright location.

In some possible implementations, the obtaining a mask picture includes:

creating an initialization picture, superimposing the initializationpicture on the icon, determining a bright location in the icon, andsetting an alpha channel value of each pixel in the initializationpicture based on the bright location in the icon, to obtain the maskpicture.

In some possible implementations, the setting an alpha channel value ofeach pixel in the initialization picture based on the bright location inthe icon includes: setting an alpha channel value of a location that isin the initialization picture and that corresponds to the brightlocation in the icon to 0, and setting an alpha channel value of aremaining location to 1.

In some possible implementations, the performing image processing on thereflective picture by using the mask picture includes:

performing image processing on the reflective picture according to thefollowing formula by using the mask picture:temp.rgba=reflective picture.rgba×mask.a, where

temp.rgba is a color value of a pixel in the reflective picture afterimage processing is performed, reflective picture.rgba is a color valueof the pixel in the reflective picture before image processing isperformed, and mask.a is an alpha channel value of a location that is inthe mask picture and that corresponds to the pixel in the reflectivepicture.

A second aspect of this application provides an image processingterminal device, including:

a memory and at least one processor, where the memory is configured tostore computer-readable instructions, and the processor is configured toexecute the computer-readable instructions in the memory, to perform thefollowing operations:

obtaining a reflective picture, superimposing the reflective picture onan icon, and changing a color value of at least one pixel in a part thatis of the reflective picture and that overlaps the icon.

The reflective picture is obtained, the reflective picture issuperimposed on the icon, and the color value of the at least one pixelin the part that is of the reflective picture and that overlaps the iconis changed, so that the icon is enabled to display a dynamic effect.Optionally, the reflective picture is a semitransparent picture. In thiscase, the dynamic effect of the icon may be implemented when the icon isdisplayed.

In some possible implementations, the terminal device for obtaining areflective picture includes:

creating a fully transparent picture, setting at least one target pointin the fully transparent picture, setting a color value of the at leastone target point, and determining a color value of a remaining pixel inthe fully transparent picture based on the color value of the at leastone target point.

In some possible implementations, the determining a color value of aremaining pixel in the fully transparent picture based on the colorvalue of the at least one target point includes:

dividing the fully transparent picture into a plurality of triangles byusing the at least one target point, and for any point G in the fullytransparent picture, calculating a color value of the point G based oncolor values of three points of a triangle in which the point G islocated.

In some possible implementations, the calculating a color value of thepoint G based on color values of three points of a triangle in which thepoint G is located includes:

separately connecting the point G to the three points of the triangle,to divide the triangle into three parts, and calculating the color valueof the point G according to the following formula:G=C1×g1/g+C2×g2/g+C3×g3/g, where G represents the color value of thepoint G, g1, g2, and g3 respectively represent areas of the three partsof the triangle, and g represents an area of the triangle.

In some possible implementations, both an edge of the reflective pictureand an edge of the icon are rectangular, and a length and a width of theedge of the reflective picture are respectively greater than a lengthand a width of the edge of the icon.

In some possible implementations, the changing a color value of at leastone pixel in a part that is of the reflective picture and that overlapsthe icon includes: changing a location of the icon in the reflectiveicon.

In some possible implementations, the processor is further configured toobtain sensing information. The changing a location of the icon in thereflective icon includes: determining the location of the icon in thereflective icon based on the sensing information.

In some possible implementations, the obtaining sensing informationincludes: obtaining an angle between the terminal device and ahorizontal direction by using a gyroscope, and performing normalizationprocessing on the angle to obtain a normalized value ranging from 0to 1. The determining the location of the icon in the reflective iconbased on the sensing information includes: determining the location ofthe icon in the reflective icon based on the normalized value.

In some possible implementations, after the changing a color value of atleast one pixel in a part that is of the reflective picture and thatoverlaps the icon, the following operations are further performed:obtaining a mask picture, and performing image processing on thereflective picture by using the mask picture.

In some possible implementations, the obtaining a mask picture includes:

creating an initialization picture, superimposing the initializationpicture on the icon, determining a bright location in the icon, andsetting an alpha channel value of each pixel in the initializationpicture based on the bright location in the icon, to obtain the maskpicture.

In some possible implementations, the setting an alpha channel value ofeach pixel in the initialization picture based on the bright location inthe icon includes: setting an alpha channel value of a location that isin the initialization picture and that corresponds to the brightlocation in the icon to 0, and setting an alpha channel value of aremaining location to 1.

In some possible implementations, image processing is performed on thereflective picture according to the following formula by using the maskpicture: temp.rgba=reflective picture.rgba×mask.a, where temp.rgba is acolor value of a pixel in the reflective picture after image processingis performed, reflective picture.rgba is a color value of the pixel inthe reflective picture before image processing is performed, and mask.ais an alpha channel value of a location that is in the mask picture andthat corresponds to the pixel in the reflective picture.

Still another aspect of this application provides a computer-readablestorage medium. The computer-readable storage medium storesinstructions. When the instructions are run on a computer, the computeris enabled to perform the method according to the foregoing aspect.

It can be learned from the foregoing technical solutions that theembodiments of this application have the following advantages:

obtaining the reflective picture, superimposing the reflective pictureon the icon, and changing the color value of the at least one pixel inthe part that is of the reflective picture and that overlaps the icon,to enable the icon to display the dynamic effect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic structural diagram of a mobile phone:

FIG. 2 is a schematic diagram of an embodiment of an image transmissionmethod;

FIG. 3-1 is a schematic diagram of a method for obtaining a reflectivepicture with a gradient effect;

FIG. 3-2 is a schematic diagram of a target point in a reflectivepicture;

FIG. 3-3 is a schematic diagram of dividing a fully transparent pictureinto a plurality of triangles:

FIG. 3-4 is a schematic diagram of calculating a color value of anypoint in a triangle;

FIG. 3-5 is an effect diagram of a reflective picture;

FIG. 3-6 is a schematic diagram of dividing a fully transparent pictureinto a plurality of quadrangles:

FIG. 3-7 is a schematic diagram of calculating a color value of anypoint in a quadrangle;

FIG. 3-8 is a schematic diagram in which a quantity of target points istwo:

FIG. 3-9 is a schematic diagram in which a quantity of target points isfive;

FIG. 4-1 is a schematic diagram of an icon:

FIG. 4-2 is an effect diagram of superimposing a reflective picture onan icon;

FIG. 4-3 is another effect diagram of superimposing a reflective pictureon an icon;

FIG. 4-4 is another effect diagram of superimposing a reflective pictureon an icon;

FIG. 4-5 is another effect diagram of superimposing a reflective pictureon an icon;

FIG. 4-6 is another effect diagram of superimposing a reflective pictureon an icon;

FIG. 4-7 is another effect diagram of superimposing a reflective pictureon an icon;

FIG. 5-1 is a schematic diagram of a method for triggering a dynamiceffect of an icon by obtaining sensing information:

FIG. 5-2 is a schematic diagram of a normalized value and acorresponding location of an icon in a reflective picture;

FIG. 6-1 is a schematic diagram of a method for obtaining a maskpicture;

FIG. 6-2 is a schematic diagram of a mask picture;

FIG. 6-3 is an effect diagram of a reflective picture on which imageprocessing is performed by using a mask picture;

FIG. 6-4 is an effect diagram of superimposing, on an icon, a reflectivepicture on which image processing is performed by using a mask picture:and

FIG. 7 is a schematic diagram of an embodiment of a terminal device.

DESCRIPTION OF EMBODIMENTS

Embodiments of this application provide an image processing method, toenable an icon to display a dynamic effect.

In the specification, claims, and accompanying drawings of thisapplication, the terms “first”. “second”, “third”, “fourth”, and thelike (if existent) are intended to distinguish between similar objectsbut do not necessarily indicate a specific order or sequence. It shouldbe understood that the data termed in such a way are interchangeable inan appropriate circumstance, so that the embodiments described hereincan be implemented in another order than the order illustrated ordescribed herein. Moreover, the terms “include”, “have” and any othervariants mean to cover the non-exclusive inclusion, for example, aprocess, method, system, product, or device that includes a list ofsteps or units is not necessarily limited to those steps or units, butmay include other steps or units not expressly listed or inherent tosuch a process, method, product, or device.

This application is applied to a terminal device. The terminal devicementioned in the embodiments of this application may be a device thatprovides a user with voice and/or data connectivity, a handheld devicewith a wireless connection function, or another processing deviceconnected to a wireless modem. A wireless terminal may communicate withone or more core networks through a radio access network (RAN RadioAccess Network). The wireless terminal may be a mobile terminal, such asa mobile phone (also referred to as a “cellular” phone) and a computerwith a mobile terminal, for example, may be a portable, pocket-sized,handheld, computer built-in, or vehicle-mounted mobile apparatus, whichexchanges voice and/or data with the radio access network. For example,the wireless terminal may be a device such as a personal communicationservice (PCS, Personal Communication Service) phone, a cordlesstelephone set, a session initiation protocol (SIP) phone, a wirelesslocal loop (WLL, Wireless Local Loop) station, or a personal digitalassistant (PDA, Personal Digital Assistant). The wireless terminal mayalso be referred to as a system, a subscriber unit (Subscriber Unit), asubscriber station (Subscriber Station), a mobile station (MobileStation), a mobile station (Mobile), a remote station (Remote Station),an access point (Access Point), a remote terminal (Remote Terminal), anaccess terminal (Access Terminal), a user terminal (User Terminal), aterminal device, a user agent (User Agent), a user device (User Device),or user equipment (User Equipment).

A mobile phone is used as an example. Referring to FIG. 1 (which is aschematic structural diagram of the mobile phone), the mobile phoneincludes a radio frequency (Radio Frequency, RF) circuit 1110, a memory1120, an input unit 1130, a display unit 1140, a sensor 1150, an audiocircuit 1160, a wireless fidelity (wireless fidelity, Wi-Fi) module1170, a processor 1180, and a power supply 1190. A person skilled in theart may understand that a structure of the mobile phone shown in FIG. 1does not constitute a limitation on the mobile phone. The mobile phonemay include more or fewer components than those shown in the figure, ormay include a combination of some components, or may have differentcomponent arrangements.

The following describes each component of the mobile phone in detailwith reference to FIG. 1 .

The RF circuit 1110 may be configured to send and receive signals in aninformation sending and receiving process or a call process.Particularly, the RF circuit 1110 receives downlink information from abase station, and then delivers the downlink information to theprocessor 1180 for processing. In addition, the RF circuit 1110 sendsrelated uplink data to the base station. Usually, the RF circuit 1110includes but is not limited to an antenna, at least one amplifier, atransceiver, a coupler, a low noise amplifier (Low Noise Amplifier,LNA), a duplexer, and the like. In addition, the RF circuit 1110 mayfurther communicate with a network and another device through wirelesscommunication. Any communications standard or protocol may be used forthe wireless communication, including but not limited to a global systemfor mobile communications (Global System of Mobile communication, GSM),a general packet radio service (General Packet Radio Service, GPRS),code division multiple access (Code Division Multiple Access, CDMA),wideband code division multiple access (Wideband Code Division MultipleAccess, WCDMA), long term evolution (Long Term Evolution, LTE), anemail, a short message service (Short Messaging Service, SMS), and thelike.

The memory 1120 may be configured to store a software program and amodule. The processor 1180 executes various function applications of themobile phone and processes data by running the software program and themodule that are stored in the memory 1120. The memory 1120 may mainlyinclude a program storage area and a data storage area. The programstorage area may store an operating system, an application required byat least one function (such as a voice playing function and an imageplaying function), and the like. The data storage area may store data(such as audio data and a phone book) that is created based on use ofthe mobile phone, and the like. In addition, the memory 1120 may includea high-speed random access memory, and may further include a nonvolatilememory such as at least one magnetic disk storage device and a flashmemory device, or another volatile solid-state storage device.

The input unit 1130 may be configured to: receive entered digit orcharacter information, and generate a key signal input related to a usersetting and function control of the mobile phone. Specifically, theinput unit 1130 may include a touch panel 1131 and another input device1132. The touch panel 1131, also referred to as a touchscreen, maycollect a touch operation (for example, an operation performed by a useron or near the touch panel 1131 by using any suitable object oraccessory such as a finger or a stylus) performed by the user on or nearthe touch panel 1131, and may drive a corresponding connection apparatusbased on a preset program. Optionally, the touch panel 1131 may includetwo parts: a touch detection apparatus and a touch controller. The touchdetection apparatus detects a touch direction of the user, detects asignal brought by the touch operation, and transmits the signal to thetouch controller. The touch controller receives touch information fromthe touch detection apparatus, converts the touch information into touchpoint coordinates, sends the touch point coordinates to the processor1180, and receives and executes a command sent by the processor 1180. Inaddition, the touch panel 1131 may be implemented in a plurality oftypes, such as a resistive type, a capacitive type, an infrared type,and a surface acoustic wave type. The input unit 1130 may furtherinclude the another input device 1132 in addition to the touch panel1131. Specifically, the another input device 1132 may include but is notlimited to one or more of a physical keyboard, a function key (such as avolume control key or a power on/off key), a trackball, a mouse, ajoystick, and the like.

The display unit 1140 may be configured to display information enteredby the user or information provided for the user, and various menus ofthe mobile phone. The display unit 1140 may include a display panel1141. Optionally, the display panel 1141 may be configured in a form ofa liquid crystal display (Liquid Crystal Display, LCD), an organiclight-emitting diode (Organic Light-Emitting Diode, OLED), or the like.Further, the touch panel 1131 may cover the display panel 1141. Afterthe touch panel 1131 detects a touch operation on or near the touchpanel 1131, the touch operation is transmitted to the processor 1180 todetermine a type of a touch event. Then, the processor 1180 provides acorresponding visual output on the display panel 1141 based on the typeof the touch event. Although the touch panel 1131 and the display panel1141 are used as two independent parts in FIG. 1 to implement input andinput functions of the mobile phone, in some embodiments, the touchpanel 1131 and the display panel 1141 may be integrated to implement theinput and output functions of the mobile phone.

The mobile phone may further include at least one sensor 1150, such asan optic sensor, a movement sensor, and another sensor. Specifically,the optic sensor may include an ambient light sensor and a proximitysensor. The ambient light sensor may adjust luminance of the displaypanel 1141 based on brightness of ambient light. The proximity sensormay turn off the display panel 1141 and/or backlight when the mobilephone approaches an ear. As a type of motion sensor, an accelerometersensor may detect a value of acceleration in each direction (usually onthree axes), may detect a value and a direction of gravity in astationary state, and may be used in an application for identifying amobile phone posture (such as screen switching between a landscape modeand a portrait mode, a related game, or magnetometer posturecalibration), a function related to vibration identification (such as apedometer or a knock), or the like. Other sensors such as a gyroscope, abarometer, a hygrometer, a thermometer, or an infrared sensor mayfurther be configured in the mobile phone. Details are not describedherein again.

The audio circuit 1160, a speaker 1161, and a microphone 1162 mayprovide an audio interface between the user and the mobile phone. Theaudio circuit 1160 may convert received audio data into an electricalsignal, and then transmit the electrical signal to the speaker 1161, andthe speaker 1161 converts the electrical signal into a sound signal foroutput. In addition, the microphone 1162 converts a collected soundsignal into an electrical signal. The audio circuit 1160 receives theelectrical signal, converts the electrical signal into audio data, andthen outputs the audio data to the processor 1180 for processing. Afterthe processing, the processor 1180 sends the audio data to, for example,another mobile phone through the RF circuit 1110, or outputs the audiodata to the memory 1120 for further processing.

Wi-Fi is a short-distance wireless transmission technology. With theWi-Fi module 1170, the mobile phone may help the user send and receivean email, browse a web page, access streaming media, and the like. TheWi-Fi module 1170 provides wireless access to the broadband internet forthe user. Although FIG. 1 shows the Wi-Fi module 1170, it can beunderstood that the Wi-Fi module 1170 is not a necessary constituent ofthe mobile phone and may be omitted as required provided that theessence of the present invention is not changed.

The processor 1180 is a control center of the mobile phone, connectsvarious components of the entire mobile phone through various interfacesand lines, and executes various functions and processes data of themobile phone by running or executing the software program and/or themodule stored in the memory 1120 and invoking data stored in the memory1120, to perform overall monitoring on the mobile phone. Optionally, theprocessor 1180 may include one or more processing units. Preferably, anapplication processor and a modem processor may be integrated into theprocessor 1180. The application processor mainly processes an operatingsystem, a user interface, an application, and the like. The modemprocessor mainly processes wireless communication. It may be understoodthat the modem processor may alternatively not be integrated into theprocessor 1180.

The mobile phone further includes the power supply 1190 (such as abattery) supplying power to the components. Preferably, the power supplymay be logically connected to the processor 1180 by using a powermanagement system, to implement functions such as management ofcharging, discharging, and power consumption by using the powermanagement system. Although not shown, the mobile phone may furtherinclude a camera, a Bluetooth module, and the like. Details are notdescribed herein again.

An icon is used to indicate software or an application to a user. In aprocess in which the user performs human-machine interaction with aterminal such as a mobile phone or a computer, the user clicks the iconby using a mouse or a finger to open the software or the application.The icon is a user's first impression of the software or theapplication, and has great impact on promotion of the software or theapplication. Currently, the icon is mainly static, that is, the icon isdisplayed as a still picture on the terminal. More vendors proposedynamic icon solutions. However, dynamic icons in the solutions aregenerally used in applications such as a calendar and a clock, whereicon statuses such as time and a date are refreshed at a specificinterval according to the solutions. For example, on an iPhone, a homescreen clock icon changes with time. For another example, on a Huaweiphone, a calendar icon changes with a date. The dynamic icon is mainlyapplied to the software or the application such as the calendar or theclock. There is no dynamic icon solution for common software or a commonapplication.

This application provides an image processing method. A reflectivepicture is first obtained, and then the reflective picture issuperimposed on an icon. A color value of at least one pixel in a partthat is of the reflective picture and that overlaps the icon is changed,to enable the icon to display a dynamic effect.

In view of this, referring to FIG. 2 , this application provides animage transmission method, including the following steps.

201. Obtain a reflective picture.

In some possible implementations, the reflective picture may be aready-made reflective picture, or the reflective picture may be obtainedthrough program calculation.

It should be noted that “semitransparent” means that an alpha channelvalue of any pixel in the reflective picture is less than 1. An alphachannel value is generally used as a parameter of opacity and can beexpressed as a percentage, an integer, or a decimal ranging from 0 to 1.The percentage is used as an example. If an alpha channel value of apixel is 0%, the pixel is completely transparent, that is, completelyinvisible. If the pixel is superimposed on another pixel, thesuperimposed pixel is completely displayed. If an alpha channel value ofa pixel is 100%, it means that the pixel is completely opaque. In otherwords, if the pixel is superimposed on another pixel, the superimposedpixel is completely blocked. A pixel whose alpha channel value between0% and 100% is a semitransparent pixel. If the semitransparent pixel issuperimposed on another pixel, both the semitransparent pixel and thesuperimposed pixel may be displayed. This is like seeing, through tintedtransparent glass (the semitransparent pixel), an object behind theglass (the another pixel).

Hereinafter, the reflective picture obtained through the programcalculation is used as an example for description.

It should be noted that, if the reflective picture is a picture withdistinct colors at different locations, when the reflective picture issuperimposed on an icon, recognition of the icon is affected. However,if a color of the reflective picture is monotonous, a dynamic effect isnot obvious. Therefore, a reflective picture with a better effect shouldbe a picture that does not affect recognition of an icon and hasrelatively rich colors, for example, a picture with a gradient effect.Therefore, in this embodiment of this application, a reflective picturewith a gradient effect may be created.

FIG. 3-1 shows a method for obtaining the reflective picture with thegradient effect. The method includes the following steps.

2011: Create a fully transparent picture.

In some possible implementations, the fully transparent picture may beas large as the icon, or may be larger than the icon. This is notlimited herein. The fully transparent picture is a picture in which RGBAvalues of all pixels are (0, 0, 0, 0). The RGBA value means that anadditional alpha channel value is added to an RGB color model and usedas a fourth dimension to describe color space. A color value in thisembodiment of this application is an RGBA value. It should be noted thatthe alpha channel value may range from 0 to 1, or may range from 0 to100%. In this embodiment of this application, 0 to 1 is used as anexample for description.

In some possible implementations, the color value may be represented byusing an RGB value or the RGBA value. The RGB value is a color standardbased on the RGB color model. Various colors are obtained by changingred, green, and blue color channels and superimposing the colorchannels. The three letters “RGB” are respectively initial letters ofred, green, and blue. The RGB value may be represented by athree-dimensional vector (R, G, B). In some possible implementations, avalue range of an R value/G value/B value may be 0 to 255. For example,(255, 0, 0) represents pure red, (0, 255, 0) represents pure green,(128, 0, 128) represents purple, (0, 0, 0) represents pure black, and(255, 255, 255) represents pure white. The RGB color model can describealmost all colors that human vision can perceive, and is one of mostwidely used color systems at present.

Therefore, a pixel whose RGBA value is (0, 0, 0, 0) is a black pixelbecause an R value, a G value, and a B value are all 0. However, becausean alpha channel value of the pixel is 0, the pixel is completelytransparent. The pixel is invisible regardless of being superimposed onany background, but the superimposed background is displayed. In thisembodiment of this application, the fully transparent picture iscreated, and an RGBA value of the fully transparent picture is (0, 0, 0,0). In other words, the picture is fully transparent. In this case, thefully transparent picture is invisible regardless of being superimposedon any background.

2012: Set at least one target point in the fully transparent picture.

It should be noted that a quantity and locations of the target pointsmay be randomly set, or may be fixedly set in advance. This is notlimited herein. In this embodiment of this application, as shown in FIG.3-2 (which is a schematic diagram of target points in the reflectivepicture), there are four target points, respectively disposed at C1, C2,C3, and C4.

2013: Set a color value of the at least one target point.

In some possible implementations, the color value of the at least onetarget point may be preset or randomly set. In this embodiment of thisapplication, a color value, namely, an RGBA value, of at least one ofthe target points C1, C2, C3, and C4 shown in FIG. 3-2 may be set. Inthis case, C1=(100, 125, 241, 0.1), C2=(84, 76, 1, 0.76), C3=(77, 35,255, 0.34), and C4=(0, 45, 12, 0.53) may be set, where C1, C2, C3, andC4 respectively represent color values of the point C1, the point C2,the point C3, and the point C4.

2014: Determine a color value of a remaining pixel in the fullytransparent picture based on the color value of the at least one targetpoint.

It should be noted that, to obtain the reflective picture with thegradient effect through calculation, a color value of any non-targetpoint in the picture should be closer to a color value of a target pointwhen the any non-target point is closer to the target point, and colorvalues of any two points are closer when the any two points are closer.

In view of this, this application provides a method for determining thecolor value of the remaining pixel in the fully transparent picture byusing the at least one target point, to divide, by using four corners ofthe fully transparent picture and the at least one target point, thepicture into a plurality of triangles that do not overlap each other,and then calculate a color value of any point in the fully transparentpicture based on color values of three corners of a triangle in whichthe point is located.

Specifically, as shown in FIG. 3-3 (which is a schematic diagram ofdividing the fully transparent picture into the plurality of triangles),it is assumed that the four corners of the fully transparent picture arerespectively P1/P2/P3, and P4, and P1/P2/P3, and P4 and the four targetpoints are connected in a manner shown in FIG. 3-3 , to divide the fullytransparent picture into 10 triangles that do not overlap each other. Toensure that different triangles do not overlap, C2 and C3 are connected,and C1 and C4 are not connected. In some possible implementations,alternatively, C1 and C4 may be connected, and C2 and C3 may not beconnected. This is not limited herein.

Then, a color value of any point in the fully transparent picture may becalculated based on color values of three points of a triangle in whichthe point is located.

A point G is used as an example. As shown in FIG. 3-4 (which is aschematic diagram of calculating a color value of any point in atriangle), the point G is located in a triangle C1-C2-C3.

First, the point G is separately connected to the point C1, the pointC2, and the point C3, to divide the triangle C1-C2-C3 into three parts:respectively g1, g2, and g3. It is clear that when the point G is closerto the point C2, an area of the relative g2 is larger; when the point Gis closer to the point C1, an area of the relative g1 is larger; andwhen the point G is closer to the point C3, an area of the relative g3is larger. Based on a principle that the closer the point G is to apoint, the closer a color value of the point G is to a color value ofthe point, it can be learned that closeness of the point G to a point ispositively correlated with an area of a part relative to the point. Inthis embodiment of this application, the color value of the point G maybe determined based on C1, C2, and C3 and corresponding areas of g1, g2,and g3.

In this embodiment of this application, the color value of the point Gis calculated according to the following formula:G=C1×g1/g+C2×g2/g+C3×g3/g

G represents the color value of the point G; g1, g2, and g3 respectivelyrepresent the areas of the parts; g represents an area of the triangleC1-C2-C3; g1/g represents an area proportion of g1 to g; g2/g representsan area proportion of g2 to g; g3/g represents an area proportion of g3to g; and C1, C2, and C3 respectively represent color values of thepoint C1, the point C2, and the point C3. In this embodiment of thisapplication, when the point G is close to a point, a proportion of anarea of a relative part of the point to the area of the triangleC1-C2-C3 is used as a proportion of impact of a color value of the pointon the point G. In this case, when the point G is closer to the point,impact of the point on the color value of the point G is greater, andthe color value of the point G is closer to the color value of thepoint.

For example, if g1/g=0.3, g2/g=0.2, and g3/g=0.5, and because g3 is arelative part of C3 and g3 occupies a relatively high proportion, itindicates that the point G is closer to C3 than C1 and C2. In this case,the color value of C3 has greater impact on the color value of the pointG.

Based on the data in step 2013, the color value of the point G may becalculated as follows:

$\begin{matrix}{G = {{C1 \times 0.3} + {C2 \times 0.2} + {C3 \times 0.5}}} \\{= {{\left( {100,125,241,0.1} \right) \times 0.3} + {\left( {84,76,1,0.76} \right) \times}}} \\{0.2 + {\left( {77,35,255,0.34} \right) \times 0.5}} \\{= \left( {85.3,70.2,200,0.352} \right)}\end{matrix}$

By analogy, a color value of any pixel in the picture may be obtainedthrough calculation, and finally an effect diagram of the reflectivepicture shown in FIG. 3-5 is obtained.

It should be noted that the reflective picture formed according to theforegoing steps is a color picture, and cannot be displayed in theapplication document. Therefore, the picture shown in FIG. 3-5 is apicture obtained after grayscale processing is performed on thereflective picture.

In some possible implementations, the fully transparent picture mayalternatively be divided into a plurality of quadrilaterals, pentagons,or other polygons. The quadrilateral is used as an example. FIG. 3-6(which is a schematic diagram of dividing the fully transparent pictureinto the plurality of quadrangles) shows a division solution.

As shown in FIG. 3-7 (which is a schematic diagram of calculating acolor value of any point in a quadrangle), if the point G is in aquadrilateral C1-C2-C3-C4, the quadrilateral C1-C2-C3-C4 may be dividedinto four triangles: g1, g2, g3, and g4. In this case, a formula for thecolor value of G may be:G=½×[C1×(g1+g2)/g+C2×(g2+g4)/g+C3×(g1+g3)/g+C4×(g3+g4)/g]

G represents the color value of the point G; g1, g2, g3, and g4respectively represent areas of the parts; g represents an area of thequadrangle C1-C2-C3-C4; (g1+g2)/g represents an area proportion of g1and g2 to g; and C1, C2, and C3 respectively represent color values of apoint C1, a point C2, and a point C3. In this embodiment of thisapplication, when the point G is close to a point, a proportion of anarea of a relative part of the point to the area of the quadrangleC1-C2-C3-C4 is used as a proportion of impact of a color value of thepoint on the point G. In this case, when the point G is closer to thepoint, impact of the point on the color value of the point G is greater,and the color value of the point G is closer to the color value of thepoint. For example, a relative part of C1 is g1+g2, a relative part ofC2 is g2+g4, a relative part of C3 is g1+g3, and a relative part of C4is g3+g4. In addition, because a sum of (g1+g2)/g, (g2+g4)/g, (g1+g3)/g,and (g3+g4)/g is 2, it is necessary to multiply by ½ herein, so that avalue of each dimension in an RGBA value of the point G falls within aspecific range.

In some possible implementations, the quantity of the target points maybe one, two, three, five, or another quantity. This is not limitedherein. For example, the quantity of the target points is two. As shownin FIG. 3-8 (which is a schematic diagram in which the quantity of thetarget points is two), there are only two target points: C1 and C2. Thefully transparent picture is divided into six triangles by using C1 andC2 and the four corners of the fully transparent picture. A method forcalculating a color value of any point is shown in step 2014, anddetails are not described herein.

For example, the quantity of the target points is five. As shown in FIG.3-9 (which is a schematic diagram in which the quantity of the targetpoints is five), there are five target points: C1, C2, C3, C4, and C5.The fully transparent picture is divided into 12 triangles by using C1,C2, C3, C4, and C5 and the four corners of the fully transparentpicture. A method for calculating a color value of any point is shown instep 2014, and details are not described herein.

It should be noted that the reflective picture with the gradient effectmay be generated not only by using the foregoing method, but also inanother manner. For example, a color value (255, 255, 255, 0.9) of anypixel on the left of the reflective picture is evenly gradient to acolor value (0, 0, 0, 0.1) of any pixel on the right of the reflectivepicture. This is not limited herein. It should be noted that thereflective picture is not limited to having the gradient effect, and mayalternatively be another type of picture, such as a landscape paintingor a movie poster. This is not limited herein.

202: Superimpose the reflective picture on the icon.

After the reflective picture is obtained, the reflective picture may besuperimposed on the icon. It should be noted that both an edge of thereflective picture and an edge of the icon may be rectangular, and alength and a width of the edge of the reflective picture arerespectively greater than/equal to a length and a width of the edge ofthe icon. It should be noted that the icon in this embodiment of thisapplication is an identifier of software or an application displayed ona screen of a terminal device, and is used to identify the applicationor the software for a user, so that the user can use the application orthe software. In some possible implementations, the icon mayalternatively be an icon that functions as an identifier, for example,an identifier of a warning. This is not limited herein.

In this embodiment of this application, an icon shown in FIG. 4-1 (whichis a schematic diagram of the icon) is used as an example fordescription. It should be noted that, in actual application, the iconshown in FIG. 4-1 may be colored or black-white-gray. Due to a colorlimitation on the accompanying drawings in the application document, anexample in which the icon shown in the figure is black-white-gray isused. An alpha channel value of the icon may be 1, 0, or between 0and 1. This is not limited herein.

In this embodiment of this application, the reflective picture shown inFIG. 3-5 is superimposed on the icon shown in FIG. 4-1 to obtain aneffect shown in FIG. 4-2 (which is the effect diagram of superimposingthe reflective picture on the icon). In this embodiment of thisapplication, an example in which the reflective picture is larger thanthe icon is used for description.

If a location of the icon in the reflective picture is shown in FIG. 4-2, because an alpha channel value of the location in the reflectivepicture and at which the icon is located is relatively large, theterminal device displays an effect diagram of the ion shown in FIG. 4-3(which is another effect diagram of superimposing the reflective pictureon the icon). This icon is greatly affected by the reflective pictureand appears relatively blurry. If a location of the icon in thereflective picture is shown in FIG. 4-4 (which is another effect diagramof superimposing the reflective picture on the icon), because an alphachannel value of the location at which the icon is located is relativelysmall, the terminal device displays an effect diagram of the icon shownin FIG. 4-5 (which is another effect diagram of superimposing thereflective picture on the icon). This icon is less affected by thereflective picture and appears relatively clear. In some possibleimplementations, the reflective picture is as large as the icon. In thiscase, when the reflective picture is superimposed on the icon, an effectdiagram of the icon shown in FIG. 4-6 (which is another effect diagramof superimposing the reflective picture on the icon) is displayed.

203: Change a color value of at least one pixel in a part that is of thereflective picture and that overlaps the icon.

In this embodiment of this application, to implement a dynamic effect ofthe icon, the terminal device needs to display a changing reflectivepicture on the icon, In this case, the color value of the at least onepixel in the part that is of the reflective picture and that overlapsthe icon needs to be changed.

In some possible implementations, the location of the icon in thereflective picture may be changed, to change the color value of the atleast one pixel in the part that is of the reflective picture and thatoverlaps the icon. For example, when the location of the icon in thereflective picture is shown in FIG. 4-2 , the icon displays the effectdiagram shown in FIG. 4-3 on the terminal device. When the location ofthe icon in the reflective picture is shown in FIG. 4-4 , the icondisplays the effect diagram shown in FIG. 4-5 on the terminal device. Inthis way, the color value of the at least one pixel in the part that isof the reflective picture and that overlaps the icon is changed.

In some possible implementations, the color value of the at least onepixel in the part that is of the reflective picture and that overlapsthe icon may alternatively be randomly changed. For example, for theeffect diagram of the icon shown in FIG. 4-6 , a color value of alocation in the reflective picture and at which the icon is located maybe changed, to obtain an effect diagram of the icon shown in FIG. 4-7(which is another effect diagram of superimposing the reflective pictureon the icon).

However, when the reflective picture is a gradient picture, if a colorvalue of a part in the reflective picture is randomly changed, as shownin FIG. 4-7 , the reflective picture is caused to lose a gradientfeature. Therefore, in some feasible embodiments, if the reflectivepicture is a reflective picture that is generated according to steps2011 to 2014 and that has the gradient feature, the color value of theat least one target point may be changed, or a location of the at leastone target point may be changed. In this case, a color value of anypixel in the reflective picture needs to be calculated based on achanged color value of the at least one target point, to re-determinethe color value. This affects a color value of each pixel in the entirereflective picture. When the color value and/or the location of the atleast one target point changes, a method for calculating a color valueof a remaining pixel is the same as step 2014, and details are notdescribed herein.

In some possible implementations, the dynamic effect of the icon may benon-triggered or triggered. Non-triggering means that the dynamic effectof the icon can be automatically changed without performing anyoperation on the terminal device. However, when the screen is locked orthe terminal device is not used, the dynamic effect of the icon is notrequired. Therefore, optionally, in some possible implementations, thedynamic effect of the icon may be triggered by using some triggerconditions.

Specifically, in some possible implementations, the terminal device mayobtain sensing information, perform information processing on thesensing information to obtain an information processing result, andtrigger the dynamic effect of the icon based on the informationprocessing result. In this embodiment of this application, the dynamiceffect of the icon may be implemented by shaking the terminal device bythe user.

Referring to FIG. 5-1 , this application provides a method fortriggering the dynamic effect of the icon by obtaining the sensinginformation, and the method includes the following steps.

2031: Obtain the sensing information.

In this embodiment of this application, the terminal may obtain thesensing information by using an angle sensing sensor such as agyroscope. Specifically, the gyroscope may detect an angle between theterminal device and a horizontal direction, and the angle is used as thesensing information.

It should be noted that, in this embodiment of this application, anangle of the terminal device is represented by (a, b), where a is usedto represent the angle between the terminal device and the horizontaldirection, and b is used to represent an angle between the terminaldevice and a vertical direction. When the terminal device is placed flaton a horizontal plane, for example, on a desktop of a desk, and thescreen faces upward, a value of the angle of the terminal device is (0°,0°). If the terminal device faces downward, the value of the angle ofthe terminal device is (180°, 180°).

2032: Change the location of the icon in the reflective picture based onthe sensing information.

In this embodiment of this application, after the sensing information isobtained, information processing may be performed on the sensinginformation. In this embodiment of this application, normalizationprocessing may be performed on the value (a, b) of the angle of theterminal device to obtain a normalized value (x, y), where x=a/180°, andy=b/180°. For example, an angle (90°, 90°) is equal to a normalizedvalue (0.5, 0.5).

After the normalized value is determined, the terminal device maydetermine, based on the normalized value, to trigger the dynamic effectof the icon. In this embodiment of this application, an example in whichthe location of the icon in the reflective picture is changed is usedfor description. Specifically, x represents a horizontal coordinate ofthe location of the icon in the reflective picture, y represents avertical coordinate of the location of the icon in the reflectivepicture, and both value ranges of x and y are [0, 1]. When x is equal to0, it indicates that the icon is on the leftmost side of the reflectivepicture in the horizontal direction. When x is equal to 1, it indicatesthat the icon is on the rightmost side of the reflective picture in thehorizontal direction. When y is equal to 0, it indicates that the iconis on the bottommost side of the reflective picture in the verticaldirection. When y is equal to 1, it indicates that the icon is on thetopmost side of the reflective picture in the vertical direction.

For example, as shown in FIG. 5-2 (which is a schematic diagram of anormalized value and a corresponding location of the icon in thereflective picture), when the normalized value is equal to (0, 0), theicon is located in the lower-leftmost corner of the reflective picture.When the normalized value is equal to (1, 1), the icon is located in theupper-rightmost corner of the reflective picture. When the normalizedvalue is equal to (1, 0), the icon is located in the lower-rightmostcorner of the reflective picture. When the normalized value is equal to(0, 1), the icon is in located in the upper-leftmost corner of thereflective picture. In another case, the icon is located at a remaininglocation in the reflective picture.

According to the foregoing method, the angle between the terminal deviceand the horizontal direction is changed by shaking the terminal deviceby the user, to change different locations of the icon in the reflectivepicture, so that a location at which the icon and the reflective pictureoverlap is different. Because color values of different locations in thereflective picture are different, the dynamic effect of the icon isimplemented.

In some possible implementations, the normalized value may also affect acolor or the location of the at least one target point in the reflectivepicture, to implement the dynamic effect of the icon. This is notlimited herein. In some possible implementations, the dynamic effect ofthe icon may alternatively be triggered by using another sensinginformation, for example, a temperature sensor. This is not limitedherein.

204: Obtain a mask picture.

Optionally, the reflective picture is a semitransparent picture, and analpha channel value of each pixel ranges from 0 to 1. Therefore, whenthe reflective picture shown in FIG. 3-5 is superimposed on the iconshown in FIG. 4-1 , an effect of displaying both the icon and thereflective picture is formed, and the effect diagram, shown in FIG. 4-3, FIG. 4-5 , or FIG. 4-6 , of superimposing the reflective picture onthe icon is obtained. A relatively dim color is formed at a relativelybright location in the icon. This may affect the recognition of the iconto some extent, resulting in poor user experience. Therefore, in somepossible implementations, the reflective picture may be furtherprocessed, so that a dim color does not appear at the relatively brightlocation.

Therefore, referring to FIG. 6-1 , this application provides method forobtaining the mask picture. The method includes the following steps.

2041: Create an initialization picture.

In this embodiment of this application, the initialization picture maybe created, and named as the mask picture, which means that a locationthat is in the reflective picture and that corresponds to a relativelybright part of the icon is masked. In this embodiment of thisapplication, an initial color value of the mask picture may be (0, 0, 0,0) or (0, 0, 0, 1). If the color value of the mask picture is equal to(0, 0, 0, 0), an alpha channel value of the mask picture is 0, and theblack picture is a completely transparent black picture. If the colorvalue of the mask picture is equal to (0, 0, 0, 1), an alpha channelvalue of the mask picture is 1, and the black picture is a completelyopaque black picture.

2042: Superimpose the initialization picture on the icon.

Optionally, a size of the initialization picture is the same as that ofthe icon. When the initialization picture is superimposed on the icon,the initialization picture and the icon exactly overlap.

2043: Determine a bright location in the icon.

In this embodiment of this application, luminance of each pixel in theicon may be calculated, to determine the bright location in the icon.

Specifically, a general luminance calculation formula may be used forcalculation:Y=((R×0.299)+(G×0.587)+(B×0.114))

Y represents luminance of a pixel, R represents an R value in an RGBAvalue of the pixel, G represents a G value in the RGBA value of thepixel, and B represents a B value in the RGBA value of the pixel. If a Yvalue of a pixel is greater than a threshold (for example, 90), it isdetermined that the pixel is located at the bright location. Otherwise,it is determined that the pixel is located at a non-bright location. Theicon in FIG. 4-1 is used as an example. After the bright location in theicon is determined according to the foregoing method. FIG. 6-2 (which isa schematic diagram of the mask picture) may be obtained, where a whitepart is the bright location, and a black part is the non-brightlocation.

2044: Set an alpha channel value of each pixel in the initializationpicture based on the bright location in the icon, to obtain the maskpicture.

After the bright location and the non-bright location are determined, atthe bright location in the icon, an alpha channel value of a pixelcorresponding to the mask picture may be set to 0, and a color value ofthe pixel is (0, 0, 0, 0). At the non-bright location in the icon, analpha channel value of a pixel corresponding to the mask picture may beset to 1, and a color value of the pixel is (0, 0, 0, 1).

The mask picture is obtained according to steps 2041 to 2044.

205: Perform image processing on the reflective picture by using themask picture.

After the mask picture is obtained, image processing may be performed onthe reflective picture according to the following formula:temp.rgba=reflective picture.rgba×mask.a

temp.rgba is a color value of a pixel in the reflective picture afterimage processing is performed, reflective picture.rgba is a color valueof the pixel before image processing is performed, and mask.a is analpha channel value of a location that is in the mask picture and thatcorresponds to the pixel in the reflective picture. After the foregoingimage processing, for the bright location in the icon, an alpha channelvalue of a pixel in the reflective picture is equal to 0, that is, thepixel is invisible. For the non-bright location in the icon, an alphachannel value of a pixel in the reflective picture is equal to anoriginal value, and the pixel is visible.

For example, the size of the icon and the size of the reflective pictureare the same. For the reflective picture shown in FIG. 3-5 , after theforegoing image processing, an effect diagram shown in FIG. 6-3 (whichis an effect diagram of the reflective picture on which image processingis performed by using the mask picture) is obtained.

When the reflective picture shown in FIG. 6-3 is superimposed on theicon shown in FIG. 4-1 , an effect diagram, shown in FIG. 6-4 (which isan effect diagram of superimposing, on the icon, the reflective pictureon which image processing is performed by using the mask picture), ofthe icon may be obtained. In other words, at the bright location in theicon, the corresponding pixel in the reflective picture is invisible,and at the non-bright location in the icon, the corresponding pixel inthe reflective picture is visible.

Referring to FIG. 7 , this application provides an image processingterminal device 700, including:

a memory 701 and at least one processor 702.

The memory 701 is configured to store computer-readable instructions.

The processor 702 is configured to execute the computer-readableinstructions in the memory, to perform the following operations:

obtaining a reflective picture, superimposing the reflective picture onan icon, and changing a color value of at least one pixel in a part thatis of the reflective picture and that overlaps the icon.

In some possible implementations, the terminal device 700 for obtaininga reflective picture includes:

creating a fully transparent picture, setting at least one target pointin the fully transparent picture, setting a color value of the at leastone target point, and determining a color value of a remaining pixel inthe fully transparent picture based on the color value of the at leastone target point.

In some possible implementations, the determining a color value of aremaining pixel in the fully transparent picture based on the colorvalue of the at least one target point includes:

dividing the fully transparent picture into a plurality of triangles byusing the at least one target point, and for any point G in the fullytransparent picture, calculating a color value of the point G based oncolor values of three points of a triangle in which the point G islocated.

In some possible implementations, the calculating a color value of thepoint G based on color values of three points of a triangle in which thepoint G is located includes: separately connecting the point G to thethree points of the triangle, to divide the triangle into three parts,and calculating the color value of the point G according to thefollowing formula: G=C1×g1/g+C2×g2/g+C3×g3/g, where G represents thecolor value of the point G, g1, g2, and g3 respectively represent areasof the three parts of the triangle, and g represents an area of thetriangle.

In some possible implementations, both an edge of the reflective pictureand an edge of the icon are rectangular, and a length and a width of theedge of the reflective picture are respectively greater than a lengthand a width of the edge of the icon.

In some possible implementations, the changing a color value of at leastone pixel in a part that is of the reflective picture and that overlapsthe icon includes: changing a location of the icon in the reflectiveicon.

In some possible implementations, the at least one processor 702 isfurther configured to obtain sensing information. The changing alocation of the icon in the reflective icon includes: determining thelocation of the icon in the reflective icon based on the sensinginformation.

In some possible implementations, the obtaining sensing informationincludes: obtaining an angle between the terminal device and ahorizontal direction by using a gyroscope, and performing normalizationprocessing on the angle to obtain a normalized value ranging from 0 to1.

The determining the location of the icon in the reflective icon based onthe sensing information includes: determining the location of the iconin the reflective icon based on the normalized value.

In some possible implementations, after the changing a color value of atleast one pixel in a part that is of the reflective picture and thatoverlaps the icon, the following operations are further performed:obtaining a mask picture, and performing image processing on thereflective picture by using the mask picture. In some possibleimplementations, the obtaining a mask picture includes: creating aninitialization picture, superimposing the initialization picture on theicon, determining a bright location in the icon, and setting an alphachannel value of each pixel in the initialization picture based on thebright location in the icon, to obtain the mask picture.

In some possible implementations, the setting an alpha channel value ofeach pixel in the initialization picture based on the bright location inthe icon includes: setting an alpha channel value of a location that isin the initialization picture and that corresponds to the brightlocation in the icon to 0, and setting an alpha channel value of aremaining location to 1.

In some possible implementations, the performing image processing on thereflective picture by using the mask picture includes: performing imageprocessing on the reflective picture according to the following formulaby using the mask picture: temp.rgba=reflective picture.rgba×mask.a,where temp.rgba is a color value of a pixel in the reflective pictureafter image processing is performed, reflective picture.rgba is a colorvalue of the pixel in the reflective picture before image processing isperformed, and mask.a is an alpha channel value of a location that is inthe mask picture and that corresponds to the pixel in the reflectivepicture.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When thesoftware is used to implement the embodiments, all or some of theforegoing embodiments may be implemented in a form of a computer programproduct.

The computer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on acomputer, all or some of the procedures or the functions according tothe embodiments of the present invention are generated. The computer maybe a general-purpose computer, a dedicated computer, a computer network,or another programmable apparatus. The computer instructions may bestored in a computer-readable storage medium or may be transmitted froma computer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (digital subscriber line,DSL)) or wireless (for example, infrared, radio, or microwave) manner.The computer-readable storage medium may be any usable medium accessibleby a computer, or a data storage device, such as a server or a datacenter, integrating one or more usable media. The usable medium may be amagnetic medium (for example, a floppy disk, a hard disk, or a magnetictape), an optical medium (for example, a DVD), a semiconductor medium(for example, a solid-state drive solid state disk (SSD)), or the like.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments. Details arenot described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in another manner. For example, the described apparatusembodiments are merely examples. For example, division into the units ismerely logical function division and may be other division in an actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented through some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electrical, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,and may be located in one position, or may be distributed on a pluralityof network units. Some or all of the units may be selected based onactual requirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software function unit.

When the integrated unit is implemented in the form of a softwarefunction unit and sold or used as an independent product, the integratedunit may be stored in a computer-readable storage medium. Based on suchan understanding, the technical solutions of this applicationessentially, or the part contributing to the current technology, or allor some of the technical solutions may be implemented in the form of asoftware product. The computer software product is stored in a storagemedium and includes several instructions for instructing a computerdevice (which may be a personal computer, a server, or a network device)to perform all or some of the steps of the methods described in theembodiments of this application. The foregoing storage medium includesany medium that can store program code, such as a USB flash drive, aremovable hard disk, a read-only memory (ROM, Read-Only Memory), arandom access memory (RAM, Random Access Memory), a magnetic disk, or anoptical disc.

The foregoing embodiments are merely intended for describing thetechnical solutions of this application, but not for limiting thisapplication. Although this application is described in detail withreference to the foregoing embodiments, persons of ordinary skill in theart should understand that they may still make modifications to thetechnical solutions described in the foregoing embodiments or makeequivalent replacements to some technical features thereof, withoutdeparting from the spirit and scope of the technical solutions of theembodiments of this application.

What is claimed is:
 1. An image processing terminal device, comprising:a memory configured to store computer-readable instructions; and atleast one processor coupled to the memory and configured to execute thecomputer-readable instructions to cause the image processing terminaldevice to: obtain a reflective picture at least in part by: creating afully transparent picture; setting at least one target point in thefully transparent picture; setting a color value of the at least onetarget point; and determining a color value of a remaining pixel in thefully transparent picture based on the color value of the at least onetarget point; superimpose the reflective picture on an icon; and changea color value of at least one pixel in a part of the reflective picturethat overlaps the icon.
 2. The image processing terminal device of claim1, wherein the at least one processor is further configured to cause theimage processing terminal device to: divide the fully transparentpicture into a plurality of triangles using the at least one targetpoint; and calculate, for any point G in the fully transparent picture,a color value of the point G based on color values of three points of atriangle in which the point G is located.
 3. The image processingterminal device of claim 2, wherein the at least one processor isfurther configured to cause the image processing terminal device to:separately connect the point G to the three points of the triangle todivide the triangle into three parts; and calculate the color value ofthe point G according to the following formula:G=C1×g1/g+C2×g2/g+C3×g3/g, wherein G represents the color value of thepoint G, wherein g1, g2, and g3 respectively represent areas of thethree parts of the triangle, and wherein g represents an area of thetriangle.
 4. The image processing terminal device of claim 1, whereinboth an edge of the reflective picture and an edge of the icon arerectangular, and wherein a length and a width of the edge of thereflective picture are respectively greater than a length and a width ofthe edge of the icon.
 5. The image processing terminal device of claim4, wherein the at least one processor is further configured to cause theimage processing terminal device to change a location of the icon in thereflective picture.
 6. The image processing terminal device of claim 5,wherein the at least one processor is further configured to cause theimage processing terminal device to: obtain sensing information; anddetermine the location of the icon in the reflective picture based onthe sensing information.
 7. The image processing terminal device ofclaim 6, wherein the at least one processor is further configured tocause the image processing terminal device to: obtain an angle betweenthe image processing terminal device and a first direction using agyroscope; perform normalization processing on the angle to obtain anormalized value ranging from zero to one; and determine the location ofthe icon in the reflective picture based on the normalized value.
 8. Theimage processing terminal device of claim 1, wherein after changing thecolor value of the at least one pixel, the at least one processor isfurther configured to cause the image processing terminal device to:obtain a mask picture; and perform image processing on the reflectivepicture using the mask picture.
 9. The image processing terminal deviceof claim 8, wherein the at least one processor is further configured tocause the image processing terminal device to: create an initializationpicture; superimpose the initialization picture on the icon; determine abright location in the icon; and set an alpha channel value of eachpixel in the initialization picture based on the bright location in theicon to obtain the mask picture.
 10. The image processing terminaldevice of claim 9, wherein the at least one processor is furtherconfigured to cause the image processing terminal device to: set analpha channel value of a location in the initialization picture thatcorresponds to the bright location in the icon to zero; and set an alphachannel value of a remaining location to one.
 11. The image processingterminal device of claim 10, wherein the at least one processor isfurther configured to cause the image processing terminal device to:perform image processing on the reflective picture using the maskpicture and according to the following formula:temp.rgba=reflective picture.rgba×mask.a, wherein temp.rgba is a colorvalue of a pixel in the reflective picture after image processing isperformed, wherein reflective picture.rgba is a color value of the pixelin the reflective picture before image processing is performed, andwherein mask.a is an alpha channel value of a location in the maskpicture that corresponds to the pixel in the reflective picture.
 12. Animage processing method, comprising: obtaining a reflective picture atleast in part by: creating a fully transparent picture; setting at leastone target point in the fully transparent picture; setting a color valueof the at least one target point; and determining a color value of aremaining pixel in the fully transparent picture based on the colorvalue of the at least one target point; superimposing the reflectivepicture on an icon; and changing a color value of at least one pixel ina part of the reflective picture that overlaps the icon.
 13. The imageprocessing method of claim 12, wherein the reflective picture is asemitransparent picture.
 14. The image processing method of claim 12,further comprising: dividing the fully transparent picture into aplurality of triangles using the at least one target point; andcalculating, for any point G in the fully transparent picture, a colorvalue of the point G based on color values of three points of a trianglein which the point G is located.
 15. The image processing method ofclaim 14, further comprising: separately connecting the point G to thethree points of the triangle to divide the triangle into three parts;and calculating the color value of the point G according to thefollowing formula:G=C1×g1/g+C2×g2/g+C3×g3/g, wherein G represents the color value of thepoint G, wherein g1, g2, and g3 respectively represent areas of thethree parts of the triangle, and wherein g represents an area of thetriangle.
 16. The image processing method of claim 12, wherein both anedge of the reflective picture and an edge of the icon are rectangular,and wherein a length and a width of the edge of the reflective pictureare respectively greater than a length and a width of the edge of theicon.
 17. The image processing method of claim 16, further comprisingchanging a location of the icon in the reflective picture.
 18. The imageprocessing method of claim 17, wherein before the changing a location ofthe icon in the reflective picture, the image processing method furthercomprises: obtaining sensing information; and determining the locationof the icon in the reflective picture based on the sensing information.